<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="pragma" content="no-cache"/>
    <meta http-equiv="cache-control" content="no-cache"/>
    <meta http-equiv="expires" content="0"/>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
    <meta http-equiv="description" content="This is my page"/>

    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/base.css"/>
    <link href="${pageContext.request.contextPath}/static/css/daoke.css" rel="stylesheet" type="text/css"/>

    <link href="${pageContext.request.contextPath}/static/css/iconfont.css" rel="stylesheet" type="text/css"/>
    <script language="JavaScript" src="${pageContext.request.contextPath}/static/js/public.js"
            type="text/javascript"></script>

    <script language="javascript">
        function add() {
            var url = "${pageContext.request.contextPath}/admin/notice/addNotice.jsp";
            window.location.href = url;
        }

        function detailNotice(id) {
            var url = "${pageContext.request.contextPath}/admin/detailNotice.html?id=" + id;
            var n = "";
            var w = "200";
            var h = "300";
            var s = "resizable:no;help:no;status:no;scroll:yes";
            window.open(url, n, w, h, s);
        }
    </script>
</head>

<body leftmargin="2" topmargin="2" >
<table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
    <tr bgcolor="#E7E7E7" style="height: 30px;">
        <td height="14" colspan="5" >
            <i class="iconfont icon-tongzhi font16"></i>系统公告管理
        </td>
    </tr>
    <tr align="center" bgcolor="#FAFAF1" height="30">
        <td width="4%">序号</td>
        <td width="40%">标题</td>
        <td width="10%">发布时间</td>
        <td width="10%">内容</td>
        <td width="10%">操作</td>
    </tr>
    <c:forEach items="${noticeList}" var="notice" varStatus="status">
        <tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';"
            onMouseOut="javascript:this.bgColor='#FFFFFF';" height="35">
            <td bgcolor="#FFFFFF" align="center">
                    ${status.index+1}
            </td>
            <td bgcolor="#FFFFFF" align="center">
                    ${notice.title}
            </td>
            <td bgcolor="#FFFFFF" align="center">
                    ${notice.createTime}
            </td>
            <td bgcolor="#FFFFFF" align="center">
                <a href="#" onclick="detailNotice(id=${notice.id})" class="pn-loperator">查看内容</a>
            </td>
            <td bgcolor="#FFFFFF" align="center">
                <a class="pn-loperator"
                   href="${pageContext.request.contextPath}/admin/delNotic.html?id=${notice.id}">删除</a>
            </td>
        </tr>
    </c:forEach>
</table>

<table width='98%' border='0' style="margin-top:8px;margin-left: 5px;">
    <tr>
        <td>
            <input type="button" value="添加系统公告" style="width: 120px;height: 30px;box-sizing: border-box; border-radius: 5px;font-size: 16px;" onclick="add()"/>
        </td>
    </tr>
</table>
</body>
</html>
